export default function define(Blocks: Blockly.BlockDefinitions) {

  Blocks['compasscalibrate'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('校准罗盘');
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour('#A016E5', '#A016E5', '#732c91');
      this.setTooltip('Calibrate the compass module');
      this.setHelpUrl('');
    },
  };

  Blocks['compasscalibrated'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('罗盘已经校准');
      this.setOutput(true, null);
      this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
      this.setColour('#A016E5', '#A016E5', '#732c91');
      this.setTooltip('Is the compass calibrated?');
      this.setHelpUrl('');
    },
  };
  
    Blocks['compass_x'] = {
    init: function () {
      this.appendDummyInput()
        .appendField(new Blockly.FieldVariable('compass_x'), 'variable')
        .appendField(' 为x轴磁场上的读数');
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour('#A016E5', '#A016E5', '#732c91');
      this.setTooltip('');
      this.setHelpUrl('');
    },
  };

    Blocks['compass_y'] = {
    init: function () {
      this.appendDummyInput()
        .appendField(new Blockly.FieldVariable('compass_y'), 'variable')
        .appendField(' 为y轴磁场上的读数');
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour('#A016E5', '#A016E5', '#732c91');
      this.setTooltip('');
      this.setHelpUrl('');
    },
  };
    Blocks['compass_z'] = {
    init: function () {
      this.appendDummyInput()
        .appendField(new Blockly.FieldVariable('compass_z'), 'variable')
        .appendField(' 为z轴磁场上的读数');
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour('#A016E5', '#A016E5', '#732c91');
      this.setTooltip('');
      this.setHelpUrl('');
    },
  };

    Blocks['compass_heading'] = {
    init: function () {
      this.appendDummyInput()
        .appendField(new Blockly.FieldVariable('compass_heading'), 'variable')
        .appendField(' 为罗盘航向');
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour('#A016E5', '#A016E5', '#732c91');
      this.setTooltip('0-360整数范围，顺时针，12点钟为0');
      this.setHelpUrl('');
    },
  };
  
    Blocks['compass_fs'] = {
    init: function () {
      this.appendDummyInput()
        .appendField(new Blockly.FieldVariable('compass_fs'), 'variable')
        .appendField(' 为磁场大小');
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour('#A016E5', '#A016E5', '#732c91');
      this.setTooltip('整数');
      this.setHelpUrl('');
    },
  };

}